package com.douqu.game.main.server;

import com.douqu.game.core.entity.*;
import com.douqu.game.core.entity.goods.GoodsProp;
import com.douqu.game.core.entity.sprite.*;
import com.douqu.game.core.factory.DataFactory;
import com.douqu.game.core.factory.LoadFactory;

import java.util.Collections;

/**
 * Created by bean on 2017/7/27.
 */
public class LoadManager {

    public static void load()
    {
        LoadFactory.loadGameObject("data/Attribute", Attribute.class, DataFactory.ATTRIBUTE_KEY);
        LoadFactory.loadGameObject("data/Asset", Asset.class, DataFactory.ASSET_KEY);
        LoadFactory.loadGameObject("data/Skill", Skill.class, DataFactory.SKILL_KEY);
        LoadFactory.loadGameObject("data/Prop", GoodsProp.class, DataFactory.GOODS_PROP_KEY);
        LoadFactory.loadGameObject("data/SoldierRestrict", SoldierRestrict.class, DataFactory.SOLDIER_RESTRICT_KEY);
        LoadFactory.loadGameObject("data/AnimEvent", AnimEvent.class, DataFactory.SOLDIER_ANIM_KEY);
        LoadFactory.loadGameObject("data/Soldier", Soldier.class, DataFactory.SOLDIER_KEY);
        LoadFactory.loadGameObject("data/Card", Card.class, DataFactory.CARD_KEY);
        LoadFactory.loadGameObject("data/CardLv", CardLv.class, DataFactory.CARD_LV_KEY);
        LoadFactory.loadGameObject("data/Grade", Grade.class, DataFactory.GRADE_KEY);
        LoadFactory.loadGameObject("data/DropGroup", DropGroup.class, DataFactory.DROP_GROUP_KEY);
        LoadFactory.loadGameObject("data/PlayerLv", PlayerLv.class, DataFactory.PLAYER_LV_KEY);
        LoadFactory.loadGameObject("data/StarCheck", StarCheck.class, DataFactory.STAR_CHECK_KEY);
        LoadFactory.loadGameObject("data/Level", Level.class, DataFactory.LEVEL_KEY);
        LoadFactory.loadGameObject("data/Instance", InstanceMap.class, DataFactory.INSTANCE_KEY);
//        LoadFactory.loadGameObject("data/lottery", PlayerLv.class, DataFactory.LOTTERY_KEY);
        LoadFactory.loadInitData();

        LoadFactory.loadConfig();

        LoadFactory.loadWord();
        //加载完后，检测数据合法性
        //1.检测所有引用其它配置文件里ID的地方，看这些对象是否存在(如:资源ID，道具ID，卡牌ID是否正确)，也可在单独加载的时候检测
        //2.初始化数据里的初始卡牌的数量是否跟玩家升级表里1级的卡槽数量一致
        //3.检测是否有空数据或格式错误的配置
        //4.初始化对象必须不能为空
        //5.所有数组的数据不能重复，如初始卡牌，不能有两张相同的卡牌

    }
}
